//
//  SelectionButton.m
//  BYDailyNews
//
//  Created by bassamyan on 15/1/18.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "XCCircleSearch.h"

@implementation XCCircleSearch

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setImage:[UIImage imageNamed:@"search_discover"] forState:UIControlStateNormal];
        [self setImage:[UIImage imageNamed:@"search_discover_press"] forState:UIControlStateHighlighted];
        self.backgroundColor = RGBColor(260.0, 260.0, 260.0);
   
        [self addTarget:self  action:@selector(searchBtnClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}

-(void)searchBtnClick{
    if (self.searchBtnDidClick) {
        self.searchBtnDidClick();
    }
}

- (CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat imageSize = 18;
    return CGRectMake((contentRect.size.width-imageSize)/2, (contentRect.size.height-imageSize)/2, imageSize, imageSize);
}

@end
